package org.dtrd.modules.device.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.dtrd.modules.device.entity.bean.xty.XtyBaseResponse;
import org.dtrd.modules.device.entity.bean.xty.XtyNotifyStatusResponse;
import org.dtrd.modules.device.entity.bean.xty.XtySugarResponse;
import org.dtrd.modules.device.entity.po.DtrdEntRdXty;
import org.dtrd.modules.device.entity.request.BindDeviceRequest;
import org.dtrd.common.api.vo.Result;
import org.dtrd.modules.device.entity.request.XtySugarRecordRequest;

/**
 * @author 萧
 * @date 2021-09-01 00:02:01
 **/
public interface IDtrdEntRdXtyService extends IService<DtrdEntRdXty> {

    /**
     * 绑定设备
     *
     * @param request
     * @return
     */
    Result<?> bindDevice(BindDeviceRequest request);

    /**
     * 查询用户绑定记录
     *
     * @param patientId
     * @return
     */
    DtrdEntRdXty getBindRecord(Integer patientId);

    /**
     * 小糖医数据上报
     *
     * @param msgId
     * @param msgType
     * @param content
     */
    void onDataUpload(String msgId, String msgType, String content);

    /**
     * 验证请求源自小糖医
     *
     * @param nonce
     * @param timestamp
     * @param signature
     * @param echostr
     * @return
     */
    String onXtyConfirm(String nonce, String timestamp, String signature, String echostr);

    /**
     * 激活小糖医推送
     *
     * @return
     */
    XtyBaseResponse activeXtyPush();

    /**
     * 关闭小糖医推送
     *
     * @return
     */
    XtyBaseResponse closeXtyPush();

    /**
     * 查询小糖医推送状态
     *
     * @return
     */
    XtyNotifyStatusResponse getXtyStatus();

    /**
     * 查询小糖医服务器血糖记录
     *
     * @param request
     * @return
     */
    XtySugarResponse getXtySugarRecord(XtySugarRecordRequest request);

}
